home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / EPPC.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  3.2 KB  |  128 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Sunday, January 6, 1991 at 10:32 PM
  3.     EPPC.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.    1988-1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT EPPC;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingEPPC}
  21. {$SETC UsingEPPC := 1}
  22.  
  23. {$I+}
  24. {$SETC EPPCIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingPPCToolbox}
  27. {$I $$Shell(PInterfaces)PPCToolbox.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingProcesses}
  30. {$I $$Shell(PInterfaces)Processes.p}
  31. {$ENDC}
  32. {$IFC UNDEFINED UsingEvents}
  33. {$I $$Shell(PInterfaces)Events.p}
  34. {$ENDC}
  35. {$SETC UsingIncludes := EPPCIncludes}
  36.  
  37. CONST
  38. kHighLevelEvent = 23;
  39.  
  40. { postOptions currently supported }
  41. receiverIDMask = $0000F000;
  42. receiverIDisPSN = $00008000;
  43. receiverIDisSignature = $00007000;
  44. receiverIDisSessionID = $00006000;
  45. receiverIDisTargetID = $00005000;
  46.  
  47. systemOptionsMask = $00000F00;
  48. nReturnReceipt = $00000200;
  49.  
  50. priorityMask = $000000FF;
  51. nAttnMsg = $00000001;
  52.  
  53. { error returns from Post and Accept }
  54.  
  55. bufferIsSmall = -607;
  56. noOutstandingHLE = -608;
  57. connectionInvalid = -609;
  58. noUserInteractionAllowed = -610;        { no user interaction allowed }
  59.  
  60. { constant for return receipts }
  61.  
  62. HighLevelEventMsgClass = 'jaym';
  63. rtrnReceiptMsgID = 'rtrn';
  64. msgWasPartiallyAccepted = 2;
  65. msgWasFullyAccepted = 1;
  66. msgWasNotAccepted = 0;
  67.  
  68. TYPE
  69. TargetIDPtr = ^TargetID;
  70. TargetIDHdl = ^TargetIDPtr;
  71. TargetID = RECORD
  72.     sessionID: LONGINT;
  73.     name: PPCPortRec;
  74.     location: LocationNameRec;
  75.     recvrName: PPCPortRec;
  76.     END;
  77.  
  78.  
  79. SenderID = TargetID;
  80. SenderIDPtr = ^SenderID;
  81.  
  82. HighLevelEventMsgPtr = ^HighLevelEventMsg;
  83. HighLevelEventMsgHdl = ^HighLevelEventMsgPtr;
  84. HighLevelEventMsg = RECORD
  85.     HighLevelEventMsgHeaderLength: INTEGER;
  86.     version: INTEGER;
  87.     reserved1: LONGINT;
  88.     theMsgEvent: EventRecord;
  89.     userRefcon: LONGINT;
  90.     postingOptions: LONGINT;
  91.     msgLength: LONGINT;
  92.     END;
  93.  
  94.  
  95. FUNCTION PostHighLevelEvent(theEvent: EventRecord;
  96.                             receiverID: Ptr;
  97.                             msgRefcon: LONGINT;
  98.                             msgBuff: Ptr;
  99.                             msgLen: LONGINT;
  100.                             postingOptions: LONGINT): OSErr;
  101.     INLINE $3F3C,$0034,$A88F;
  102. FUNCTION AcceptHighLevelEvent(VAR sender: TargetID;
  103.                               VAR msgRefcon: LONGINT;
  104.                               msgBuff: Ptr;
  105.                               VAR msgLen: LONGINT): OSErr;
  106.     INLINE $3F3C,$0033,$A88F;
  107. FUNCTION GetProcessSerialNumberFromPortName(portName: PPCPortRec;VAR PSN: ProcessSerialNumber): OSErr;
  108.     INLINE $3F3C,$0035,$A88F;
  109. FUNCTION GetPortNameFromProcessSerialNumber(VAR portName: PPCPortRec;PSN: ProcessSerialNumber): OSErr;
  110.     INLINE $3F3C,$0046,$A88F;
  111.  
  112. TYPE
  113. GetSpecificFilterProcPtr = ProcPtr;     { FUNCTION MyFilter(yourDataPtr: Ptr;                }
  114.                                         {                    msgBuff: HighLevelEventMsgPtr;    }
  115.                                         {                    sender: TargetID): Boolean;        }
  116.  
  117. FUNCTION GetSpecificHighLevelEvent(aFilter: GetSpecificFilterProcPtr;yourDataPtr: UNIV Ptr;
  118.     VAR err: OSErr): BOOLEAN;
  119.     INLINE $3F3C,$0045,$A88F;
  120.  
  121.  
  122. {$ENDC}    { UsingEPPC }
  123.  
  124. {$IFC NOT UsingIncludes}
  125.     END.
  126. {$ENDC}
  127.  
  128.